<template>
  <div>
    <page-list :x-uri="uri" :custom-components="custom" :doactions="doactions" :checkbox-item="false">
      <!-- 自定义tab -->
      <template v-slot:page-tabs>
        <tabs :tabs="tabs" />
        <page-header content="课程学习记录" />
      </template>
    </page-list>
  </div>
</template>

<script>
import PageList from '@public/template/page_list.vue';
import PageHeader from '@/components/page-header';
import Tabs from './tabs';
export default {
  components: {
    PageList,
    PageHeader,
    Tabs
  },
  inject: ['reload'],
  data() {
    const userId = this.$route.params.user_id;
    return {
      uri: '/course/admin/classes/' + this.$route.params.id + '/student/' + userId + '/info',
      tabs: [
        {
          title: '班级课-学员',
          uri: '/course/classes/' + this.$route.params.id + '/student',
          meta: {
            permission: 'course.classes.default.student'
          }
        },
        {
          title: '班级课-学员-课程学习详情',
          uri: '/course/classes/' + this.$route.params.id + '/student/' + userId + '/info',
          meta: {
            permission: 'course.classes.default.student'
          }
        }
      ],
      visible: false,
      importVisible: false,
      doactions: [{ title: '学习详情', meta: {}, callback: this.study }]
    };
  },
  methods: {
    study({ row }) {
      this.$router.push('/course/video/' + row.id + '/student/' + this.$route.params.user_id + '/info');
    }
  }
};
</script>
